﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxGridView;

namespace Project_Udrinkwater.PagesAdmin
{
    public partial class Loan : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ASPxGridView2_BeforePerformDataSelect(object sender, EventArgs e)
        {
            Session["Loan_ID"] = (sender as ASPxGridView).GetMasterRowKeyValue();
        }

        protected void UpdateExportMode()
        {
            ASPxGridView1.SettingsDetail.ExportMode = (GridViewDetailExportMode)Enum.Parse(typeof(GridViewDetailExportMode), GridViewDetailExportMode.All.ToString());  
        }

        protected void LinkButton1_Command(object sender, CommandEventArgs e)
        {
            Session["Loan_ID"] = e.CommandArgument.ToString();
            Response.Redirect("~/Empoyee_Management/LoanReport.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

            UpdateExportMode();
            gridExport.WritePdfToResponse("รายงานการยืม-คืน");
        }
    }
}